Comment: MYAHLOGO set because: http://www.installaware.com/forums/viewtopic.php?f=2&t=6769
Set Variable MYAHLOGO to TRUE
Set Persistent Variable TARGETDIR to C:\Temp\Test Project
 
[DEFINE REGION: Check Application Requirements]
Get System Setting Vista UAC Elevation into CHECKSYSTEM
if Variable CHECKSYSTEM not Equals TRUE
  MessageBox: $TITLE$ Setup Error, This product requires at least User Account Control Elevation.$NEWLINE$$NEWLINE$Setup cannot continue.
  Terminate Installation
end
Get System Setting Administrator Rights into CHECKSYSTEM
if Variable CHECKSYSTEM not Equals TRUE
  MessageBox: $TITLE$ Setup Error, This product requires at least Administrator Privileges.$NEWLINE$$NEWLINE$Setup cannot continue.
  Terminate Installation
end
Get System Setting Windows 7 into CHECKSYSTEM
if Variable CHECKSYSTEM not Equals TRUE
  MessageBox: $TITLE$ Setup Error, This product requires at least Windows 7.$NEWLINE$$NEWLINE$Setup cannot continue.
  Terminate Installation
end
[END REGION]
 
[DEFINE REGION: Check/Install Application Pre-Requisites]
 
[DEFINE REGION: Check Application Pre-Requisites]
if Variable MAINTENANCE Equals TRUE
  GoTo Label: FinishPrerequisitesCheck
end
Comment: Check setup pre-requisites
Set Variable PREREQ to FALSE
Set Variable PRELIST to 
[compiler if Variable BUILDMODE not Equals PATCH]
if Variable NEEDSUPGRADE Equals TRUE
  Set Variable PREREQ to TRUE
  Set Variable PRELIST to $PRELIST$$NEWLINE$Previous Version Uninstallation
end
[compiler end]
[END REGION]
 
[DEFINE REGION: Install Application Pre-Requisites]
Comment: Install setup pre-requisites
if Variable PREREQ not Equals FALSE
  Display Dialog: prereq, wait for dialog to return (modal)
  if Variable WIZARD Equals CANCEL
    Terminate Installation
  end
  Display Dialog: progressprereq, use as progress dialog (non-modal)
  [compiler if Variable BUILDMODE not Equals PATCH]
  if Variable NEEDSUPGRADE Equals TRUE
    Set Variable REMOVEOLD to 
    Set Variable ERROROLD to 
     
    if Variable REMOVEOLD not Equals ERROR
      Install/Remove MSI Package $PRODUCTCODE$[REMOVE=ALL] (get result into variable REMOVEOLD)
    end
     
    if Variable REMOVEOLD Equals ERROR
      MessageBox: $TITLE$ Setup, Unable to uninstall old version of $TITLE$. Please uninstall it yourself using Control Panel Add-Remove Programs before attempting to install this product.$NEWLINE$$NEWLINE$$ERROROLD$
      Terminate Installation
    end
    if Variable REMOVEOLD Equals REBOOT
      MessageBox: $TITLE$ Setup, Your computer needs to be restarted before $TITLE$ Setup can continue.$NEWLINE$$NEWLINE$Please save your work in all running programs and click OK to restart your computer. Setup will resume once your computer restarts.$NEWLINE$$NEWLINE$If you click CANCEL, setup will exit. You will have to run setup again at a later time to install $TITLE$.
      if Variable REBOOTNOW Equals OK
        if Variable SILENT Equals (Ignore Case) TRUE
          Terminate with Exit Code 1001
        else
          Reboot Computer and Resume Setup
        end
      else
        Terminate with Exit Code 1001
      end
    end
    Set Variable MAINTENANCE to FALSE
  end
end
[compiler end]
label: FinishPrerequisitesCheck
Hide Dialog
[END REGION]
 
[END REGION]
Comment: {0792D4E8-B704-48C5-8EE1-B1237C33F458}
[DEFINE REGION: Define Setup Globals]
Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
Comment: Initialize Setup Globals
Get Common Folder Location Start Menu->Startup Group into STARTUPDIR
Get System Setting Windows NT Kernel (NT4, 2000, XP, 2003, Vista, 2008, 7, 2008 R2, 8, 2012) into ISNT
Get Folder Location System->Program Files Directory into PROGRAMFILES
Get Folder Location Other->Local Application Data into APPDATAFOLDER
Get Common Folder Location Start Menu->Programs Group into SHORTCUTFILESALL
Get Folder Location Start Menu->Programs Group into SHORTCUTFILES
[END REGION]
 
[DEFINE REGION: Setup User Interview]
if Variable MAINTENANCE Equals TRUE
  GoTo Label: Maintenance
else
  [compiler if Variable BUILDMODE not Equals PATCH]
  Set Variable STARTMENU to $TITLE$
  [compiler end]
end
 
label: Welcome Dialog
Display Dialog: welcome, wait for dialog to return (modal)
if Variable WIZARD Equals CANCEL
  GoTo Label: Main Install
end
[compiler if Variable BUILDMODE not Equals PATCH]
label: Destination Directory
if Variable SILENT not Equals (Ignore Case) TRUE
  Display Dialog: destination, wait for dialog to return (modal)
  if Variable WIZARD Equals BACK
    GoTo Label: Welcome Dialog
  else
    if Variable WIZARD Equals CANCEL
      GoTo Label: Main Install
    end
  end
end
label: Start Menu
if Variable WIZARD Equals BACK
  if Variable SILENT not Equals (Ignore Case) TRUE
    GoTo Label: Destination Directory
  else
    GoTo Label: Welcome Dialog
  end
else
  if Variable WIZARD Equals CANCEL
    GoTo Label: Main Install
  end
end
[compiler end]
label: Start Installation
Display Dialog: startinstallation, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: Welcome Dialog
else
  GoTo Label: Main Install
end
 
label: Maintenance
Comment: Maintenance Install/Uninstall
[DEFINE REGION: Maintenance]
label: Main_Maintenance
if Variable SILENT not Equals (Ignore Case) TRUE
  Display Dialog: maintenance, wait for dialog to return (modal)
  if Variable WIZARD Equals CANCEL
    GoTo Label: Main Install
  end
  Display Dialog: startinstallation, wait for dialog to return (modal)
  if Variable WIZARD Equals BACK
    GoTo Label: Main_Maintenance
  else
    if Variable WIZARD Equals CANCEL
      GoTo Label: Main Install
    end
  end
else
  Set Variable REMOVE to #REMOVE#
end
[END REGION]
[END REGION]
 
[DEFINE REGION: Process (Un)Installation]
label: Main Install
Comment: Exit Setup if Wizard Loop cancelled
if Variable WIZARD Equals CANCEL
  Terminate Installation
end
 
Comment: Prepare to install
Set Variable PROGRESSTEXT to Installing $TITLE$
Set Variable SUCCESS to 
Set Variable LASTERROR to 
Display Dialog: progress, use as progress dialog (non-modal)
 
Comment: Modify Target System
[DEFINE REGION: Perform Uninstallation]
if Variable REMOVE Equals TRUE
  Apply Uninstall (get result into variable SUCCESS)
  Set Variable PROGRESS to 100
else
  [END REGION]
  [DEFINE REGION: Perform First Time or Maintenance Installation]
  Comment: Install/Re-Install product
  [OFFLINE CONTENT]
  [DEFINE WEB MEDIA MyWebMediaBlock]
  Install Files #PROJDIR#\xmlfilter.dll to $TARGETDIR$\Tmp1, include subfolders
  Install Files #PROJDIR#\xmllite.dll to $TARGETDIR$\Tmp1, include subfolders
  Comment: [DEFINE WEB MEDIA MyWebMediaBlock2]
  Install Files #PROJDIR#\xmlfilter.dll to $TARGETDIR$\Tmp2, include subfolders
  Install Files #PROJDIR#\xmllite.dll to $TARGETDIR$\Tmp2, include subfolders
  [compiler if Variable BUILDMODE Equals PATCH]
  Apply Patch (get result into variable SUCCESS)
  [compiler else]
  if Variable ADVERTISE Equals TRUE
    Apply Advertised (get result into variable SUCCESS)
  else
    Apply Install (get result into variable SUCCESS)
  end
  [compiler end]
  Set Variable PROGRESS to 100
end
[END REGION]
[END REGION]
 
[DEFINE REGION: Finish Setup]
Comment: End of Installation
Hide Dialog
Display Dialog: finish, wait for dialog to return (modal)
if Variable SILENT Equals FALSE
  if Variable REMOVE Equals FALSE
    MessageBox: Reboot, You computer needs to be restarted.$NEWLINE$$NEWLINE$Do you want to restart your computer now?
    if Variable REBOOTCOMPUTER Equals YES
      Reboot Computer
    end
  end
  if Variable REBOOTCOMPUTER Equals TRUE
    if Variable SUCCESS Equals REBOOT
      Reboot Computer
    end
  end
end
[END REGION]
